//
//  WHContactsTableViewHeader.m
//  AddressBook
//
//  Created by  on 2020/7/30.
//  Copyright © 2020 wh. All rights reserved.
//
#import "MacroDefinition.h"
#import "WHContactsTableViewHeader.h"

@interface WHContactsTableViewHeader()
@property (nonatomic, strong) UILabel *titleLabel;
@end

@implementation WHContactsTableViewHeader

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self addSubview:self.titleLabel];
    }
    return self;
}

- (void)setTitleWithText:(NSString *)text
{
    self.titleLabel.text = text;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {        
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.frame = CGRectMake(0, 0, ScreenWidth, 40);
        _titleLabel.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1];
    }
    return _titleLabel;
}
@end
